<template>
  <div class="hero-container">
    <div class="content-wrapper">
      <div class="hero-content">
        <h1 class="main-title">基于协同过滤算法的智慧校园活动系统</h1>
        <p class="subtitle">连接校园，分享精彩</p>
      </div>

      <div class="cards-container">
        <div class="card user-section">
          <h2>用户入口</h2>
          <p>浏览活动、参与互动</p>
          <div class="button-group">
            <el-button 
              type="primary" 
              class="action-button"
              @click="navigateToPage('/userlogin')"
            >
              用户登录
            </el-button>
            <el-button 
              class="action-button register"
              @click="navigateToPage('/userregister')"
            >
              注册账号
            </el-button>
          </div>
        </div>

        <div class="card admin-section">
          <h2>管理员入口</h2>
          <p>活动管理与数据分析</p>
          <el-button 
            type="primary" 
            class="action-button"
            @click="navigateToPage('/adminlogin')"
          >
            管理员登录
          </el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from "vue-router";
const router = useRouter();

const navigateToPage = (path) => {
  console.log(path);
  router.push(path);
};
</script>

<style scoped>
.hero-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.content-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.hero-content {
  text-align: center;
  margin-bottom: 60px;
}

.main-title {
  font-size: 48px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 16px;
  background: linear-gradient(45deg, #0066ff, #2196f3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 20px;
  color: #86868b;
  margin: 0;
}

.cards-container {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
}

.card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px;
  min-width: 300px;
  flex: 1;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12);
}

.card h2 {
  font-size: 24px;
  color: #1d1d1f;
  margin-bottom: 12px;
}

.card p {
  color: #86868b;
  margin-bottom: 32px;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.action-button {
  width: 100%;
  height: 48px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.action-button.el-button--primary {
  background: linear-gradient(45deg, #0066ff, #2196f3);
  border: none;
}

.action-button.el-button--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(33, 150, 243, 0.2);
}

.action-button.register {
  margin-left: 0;
  background: transparent;
  border: 2px solid #e4e4e4;
  color: #666;
}

.action-button.register:hover {
  border-color: #0066ff;
  color: #0066ff;
}

@media (max-width: 768px) {
  .main-title {
    font-size: 36px;
  }

  .subtitle {
    font-size: 18px;
  }

  .card {
    padding: 32px 24px;
  }
}
</style>
